Skip to main content

DialCodePreview API

DialCodePreview is component for preview selected country dial code.

Usage Example

Import component

import { DialCodePreview } from 'react-international-phone';

Use by providing the dialCode and prefix properties.

<DialCodePreview dialCode="1" prefix="+" />

Output:

+1

Properties

dialCode *

Country dial code (iso2)

  • Type: string

prefix *

Dial code prefix

  • Type: string

disabled

Is component disabled

  • Type: boolean
  • Default: undefined

Style properties (DialCodePreviewStyleProps type)

PropTypeDescription
styleCSSPropertiesCustom styles for DialCodePreview container
classNamestringCustom className for DialCodePreview container

CSS variables

VariableDefault value
--react-international-phone-dial-code-preview-background-color--react-international-phone-background-color
--react-international-phone-dial-code-preview-border-color--react-international-phone-border-color
--react-international-phone-dial-code-preview-text-color--react-international-phone-text-color
--react-international-phone-dial-code-preview-font-size--react-international-phone-font-size
--react-international-phone-dial-code-preview-disabled-background-color--react-international-phone-disabled-background-color
--react-international-phone-dial-code-preview-disabled-text-color--react-international-phone-disabled-text-color